<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>

<head>
    <title> 调查人数列表</title>
</head>

<body>

<div id="wrapper">
    <div class="gray-bg">
        <div class="row m-t-sm">
            <div class="col-lg-12">
                <ol class="breadcrumb f-fl">
                    <li>
                        <i class="fa fa-location-arrow"></i>  <a> 调查人数列表</a>
                    </li>
                    <li class="active">
                        <strong> 调查人数列表</strong>
                    </li>
                </ol>
                <span class="navbar-right  m-r m-t-8"><a href="javascript:history.go(-1);" class="btn-primary btn-add "> <i class='fa fa-plus-square-o'></i> 返回</a></span>
            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox">
                        <div class="ibox-content">
                            <div class="search-area">
                                <form role="form" class="form-inline" id="queryform">
                                    <label for="title">
                                        <select name="question"  class="form-control form-filter" form="queryform" style="width:100%">
                                            <option value="1" selected="true">姓名</option>
                                            <c:if test="${!sys_flag}">
                                            <option value="2">企业名称</option>
                                            </c:if>
                                            <option value="3">工号</option>
                                        </select></label>
                                    <label for="title">
                                        <input type="input" placeholder="名称" name="content"
                                               id="title"
                                               class="form-control form-filter"></label>
                                    <button class="btn btn-primary" type="button" onclick="submitFilter()"> 查询</button>
                                    <button class="btn btn-primary" datatable-clear type="button"> 清除</button>
                                </form>
                            </div>
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover dataTables" id="data-table"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>


<!-- Page-Level Scripts -->
<script>
    $(document).ready(function () {
        var setting = {
            "ajax": {
                "url": "${ctx}/admin/ehm/question/people/list",
                "type": "POST"
            },
            "columns": [
                {"title": "问卷名称", "data": "logTitle", "width": "20%", "orderable": false},
                {"title": "姓名", "data": "title", "width": "15%", "orderable": false},
                {"title": "工号", "data": "workno", "width": "15%", "orderable": false},
                {"title": "企业名称", "data": "company", "width": "20%", "orderable": false},
                {"title": "问卷日期", "data": "logTime", "width": "20%", "orderable": false},
                {"title": "操作", "data": null, "width": "10%", "orderable": false}
            ],
            "columnDefs": [
                {
                    "targets": 4,
                    "render": function (data, type, row, meta) {
                        return data.substring(0,10);
                    }
                },
                {
                    "targets": 5,
                    "render": function (data, type, row, meta) {
                                return "<a class='btn btn-xs default btn-editable' href='javascript:showopen("+data.id+");'><i class='fa fa-pencil-square-o'></i> 详情 </a>"
                    },
                    "orderable": false
                }
            ],
            "order": [
                [1, "desc"]
            ]
        };
        /* Init DataTables */
        $('#data-table').DataTable(ehconfig.get_datatable_config(setting));
        submitFilter = function () {
            $('#data-table').DataTable().draw();
        }
    });

    function showopen(id){
        parent.layer.open({
            type: 2,
            title: '题目',
            shadeClose: true,
            shade: 0.8,
            area: ['1000px', '600px'],
            content: '${ctx}/admin/ehm/question/qs/edit?id='+id
        });
    }


</script>

</body>

</html>
